import request from "../../utils/request";
import API from "../api";
import { CartListResponseData, allSelect,addCart, addCartResponseData,allSelectResponseData, guessLikeResponseData,updateCart,updateCartResponseData ,deleteData,deleteCartResponseData} from "./type";
// 获取购物车列表
export const reqCartList = () => request.get<any, CartListResponseData>(API.CARTLIST)


// 加入购物车
export const reqAddCartList = (data: addCart) => request.post<any, addCartResponseData>(API.ADDCARTLIST, data)

// 全选/取消商品
export const reqCartListAllSelect = (data: allSelect) => request.put<any, allSelectResponseData>(API.ALLSELECT, data)

//修改商品
export const reqUpdateCartList = (data: updateCart,id:string) => request.put<any, updateCartResponseData>(API.ADDCARTLIST+`/${id}`, data)

// 删除商品
export const reqDeleteGoods = (data: deleteData) => request.delete<any, deleteCartResponseData>(API.DELETEGOODS, {data})

// 猜你喜欢
export const reqGuessLike = () => request.get<any, guessLikeResponseData>(API.GUESSLIKE)

